{"ast":null,"code":"import _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useControlled as useControlled, unstable_useForkRef as useForkRef, unstable_useId as useId } from '@mui/utils';\nimport { useButton } from '../ButtonUnstyled';\nimport { useListbox, defaultListboxReducer, ActionTypes } from '../ListboxUnstyled';\nimport defaultOptionStringifier from './defaultOptionStringifier';\nfunction useSelect(props) {\n  var buttonRefProp = props.buttonRef,\n    defaultValue = props.defaultValue,\n    _props$disabled = props.disabled,\n    disabled = _props$disabled === void 0 ? false : _props$disabled,\n    listboxIdProp = props.listboxId,\n    listboxRefProp = props.listboxRef,\n    _props$multiple = props.multiple,\n    multiple = _props$multiple === void 0 ? false : _props$multiple,\n    onChange = props.onChange,\n    onOpenChange = props.onOpenChange,\n    _props$open = props.open,\n    open = _props$open === void 0 ? false : _props$open,\n    options = props.options,\n    _props$optionStringif = props.optionStringifier,\n    optionStringifier = _props$optionStringif === void 0 ? defaultOptionStringifier : _props$optionStringif,\n    valueProp = props.value;\n  var buttonRef = React.useRef(null);\n  var handleButtonRef = useForkRef(buttonRefProp, buttonRef);\n  var listboxRef = React.useRef(null);\n  var listboxId = useId(listboxIdProp);\n  var _useControlled = useControlled({\n      controlled: valueProp,\n      default: defaultValue,\n      name: 'SelectUnstyled',\n      state: 'value'\n    }),\n    _useControlled2 = _slicedToArray(_useControlled, 2),\n    value = _useControlled2[0],\n    setValue = _useControlled2[1];\n\n  // prevents closing the listbox on keyUp right after opening it\n  var ignoreEnterKeyUp = React.useRef(false);\n\n  // prevents reopening the listbox when button is clicked\n  // (listbox closes on lost focus, then immediately reopens on click)\n  var ignoreClick = React.useRef(false);\n\n  // Ensure the listbox is focused after opening\n  var _React$useState = React.useState(false),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    listboxFocusRequested = _React$useState2[0],\n    requestListboxFocus = _React$useState2[1];\n  var focusListboxIfRequested = React.useCallback(function () {\n    if (listboxFocusRequested && listboxRef.current != null) {\n      listboxRef.current.focus();\n      requestListboxFocus(false);\n    }\n  }, [listboxFocusRequested]);\n  var handleListboxRef = useForkRef(listboxRefProp, listboxRef, focusListboxIfRequested);\n  React.useEffect(function () {\n    focusListboxIfRequested();\n  }, [focusListboxIfRequested]);\n  React.useEffect(function () {\n    requestListboxFocus(open);\n  }, [open]);\n  var createHandleMouseDown = function createHandleMouseDown(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onMous;\n      otherHandlers == null ? void 0 : (_otherHandlers$onMous = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);\n      if (!event.defaultPrevented && open) {\n        ignoreClick.current = true;\n      }\n    };\n  };\n  var createHandleButtonClick = function createHandleButtonClick(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onClic;\n      otherHandlers == null ? void 0 : (_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);\n      if (!event.defaultPrevented && !ignoreClick.current) {\n        onOpenChange == null ? void 0 : onOpenChange(!open);\n      }\n      ignoreClick.current = false;\n    };\n  };\n  var createHandleButtonKeyDown = function createHandleButtonKeyDown(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onKeyD;\n      otherHandlers == null ? void 0 : (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);\n      if (event.defaultPrevented) {\n        return;\n      }\n      if (event.key === 'Enter') {\n        ignoreEnterKeyUp.current = true;\n      }\n      if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n        event.preventDefault();\n        onOpenChange == null ? void 0 : onOpenChange(true);\n      }\n    };\n  };\n  var createHandleListboxKeyUp = function createHandleListboxKeyUp(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onKeyU;\n      otherHandlers == null ? void 0 : (_otherHandlers$onKeyU = otherHandlers.onKeyUp) == null ? void 0 : _otherHandlers$onKeyU.call(otherHandlers, event);\n      if (event.defaultPrevented) {\n        return;\n      }\n      var closingKeys = multiple ? ['Escape'] : ['Escape', 'Enter', ' '];\n      if (open && !ignoreEnterKeyUp.current && closingKeys.includes(event.key)) {\n        var _buttonRef$current;\n        buttonRef == null ? void 0 : (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();\n      }\n      ignoreEnterKeyUp.current = false;\n    };\n  };\n  var createHandleListboxItemClick = function createHandleListboxItemClick(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onClic2;\n      otherHandlers == null ? void 0 : (_otherHandlers$onClic2 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic2.call(otherHandlers, event);\n      if (event.defaultPrevented) {\n        return;\n      }\n      if (!multiple) {\n        onOpenChange == null ? void 0 : onOpenChange(false);\n      }\n    };\n  };\n  var createHandleListboxBlur = function createHandleListboxBlur(otherHandlers) {\n    return function (event) {\n      var _otherHandlers$onBlur;\n      otherHandlers == null ? void 0 : (_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);\n      if (!event.defaultPrevented) {\n        onOpenChange == null ? void 0 : onOpenChange(false);\n      }\n    };\n  };\n  var listboxReducer = function listboxReducer(state, action) {\n    var newState = defaultListboxReducer(state, action);\n\n    // change selection when listbox is closed\n    if (action.type === ActionTypes.keyDown && !open && (action.event.key === 'ArrowUp' || action.event.key === 'ArrowDown')) {\n      return _extends({}, newState, {\n        selectedValue: newState.highlightedValue\n      });\n    }\n    if (action.type === ActionTypes.blur || action.type === ActionTypes.setValue || action.type === ActionTypes.optionsChange) {\n      return _extends({}, newState, {\n        highlightedValue: newState.selectedValue\n      });\n    }\n    return newState;\n  };\n  var _useButton = useButton({\n      disabled: disabled,\n      ref: handleButtonRef\n    }),\n    getButtonRootProps = _useButton.getRootProps,\n    buttonActive = _useButton.active,\n    buttonFocusVisible = _useButton.focusVisible;\n  var selectedOption = React.useMemo(function () {\n    var _props$options$find;\n    return props.multiple ? props.options.filter(function (o) {\n      return value.includes(o.value);\n    }) : (_props$options$find = props.options.find(function (o) {\n      return o.value === value;\n    })) != null ? _props$options$find : null;\n  }, [props.multiple, props.options, value]);\n  var useListboxParameters;\n  if (props.multiple) {\n    var onChangeMultiple = onChange;\n    useListboxParameters = {\n      id: listboxId,\n      isOptionDisabled: function isOptionDisabled(o) {\n        var _o$disabled;\n        return (_o$disabled = o == null ? void 0 : o.disabled) != null ? _o$disabled : false;\n      },\n      optionComparer: function optionComparer(o, v) {\n        return (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value);\n      },\n      listboxRef: handleListboxRef,\n      multiple: true,\n      onChange: function onChange(e, newOptions) {\n        var newValues = newOptions.map(function (o) {\n          return o.value;\n        });\n        setValue(newValues);\n        onChangeMultiple == null ? void 0 : onChangeMultiple(e, newValues);\n      },\n      options: options,\n      optionStringifier: optionStringifier,\n      value: selectedOption\n    };\n  } else {\n    var onChangeSingle = onChange;\n    useListboxParameters = {\n      id: listboxId,\n      isOptionDisabled: function isOptionDisabled(o) {\n        var _o$disabled2;\n        return (_o$disabled2 = o == null ? void 0 : o.disabled) != null ? _o$disabled2 : false;\n      },\n      optionComparer: function optionComparer(o, v) {\n        return (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value);\n      },\n      listboxRef: handleListboxRef,\n      multiple: false,\n      onChange: function onChange(e, option) {\n        var _option$value, _option$value2;\n        setValue((_option$value = option == null ? void 0 : option.value) != null ? _option$value : null);\n        onChangeSingle == null ? void 0 : onChangeSingle(e, (_option$value2 = option == null ? void 0 : option.value) != null ? _option$value2 : null);\n      },\n      options: options,\n      optionStringifier: optionStringifier,\n      stateReducer: listboxReducer,\n      value: selectedOption\n    };\n  }\n  var _useListbox = useListbox(useListboxParameters),\n    getListboxRootProps = _useListbox.getRootProps,\n    getListboxOptionProps = _useListbox.getOptionProps,\n    getOptionState = _useListbox.getOptionState,\n    highlightedOption = _useListbox.highlightedOption,\n    listboxSelectedOption = _useListbox.selectedOption;\n  var getButtonProps = function getButtonProps() {\n    var otherHandlers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    return _extends({}, getButtonRootProps(_extends({}, otherHandlers, {\n      onClick: createHandleButtonClick(otherHandlers),\n      onMouseDown: createHandleMouseDown(otherHandlers),\n      onKeyDown: createHandleButtonKeyDown(otherHandlers)\n    })), {\n      role: 'combobox',\n      'aria-expanded': open,\n      'aria-haspopup': 'listbox',\n      'aria-controls': listboxId\n    });\n  };\n  var getListboxProps = function getListboxProps() {\n    var otherHandlers = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n    return getListboxRootProps(_extends({}, otherHandlers, {\n      onBlur: createHandleListboxBlur(otherHandlers),\n      onKeyUp: createHandleListboxKeyUp(otherHandlers)\n    }));\n  };\n  var getOptionProps = function getOptionProps(option) {\n    var otherHandlers = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n    return getListboxOptionProps(option, _extends({}, otherHandlers, {\n      onClick: createHandleListboxItemClick(otherHandlers)\n    }));\n  };\n  React.useDebugValue({\n    selectedOption: listboxSelectedOption,\n    highlightedOption: highlightedOption,\n    open: open\n  });\n  return {\n    buttonActive: buttonActive,\n    buttonFocusVisible: buttonFocusVisible,\n    disabled: disabled,\n    getButtonProps: getButtonProps,\n    getListboxProps: getListboxProps,\n    getOptionProps: getOptionProps,\n    getOptionState: getOptionState,\n    open: open,\n    value: value\n  };\n}\nexport default useSelect;","map":{"version":3,"names":["_extends","React","unstable_useControlled","useControlled","unstable_useForkRef","useForkRef","unstable_useId","useId","useButton","useListbox","defaultListboxReducer","ActionTypes","defaultOptionStringifier","useSelect","props","buttonRefProp","buttonRef","defaultValue","disabled","listboxIdProp","listboxId","listboxRefProp","listboxRef","multiple","onChange","onOpenChange","open","options","optionStringifier","valueProp","value","useRef","handleButtonRef","controlled","default","name","state","setValue","ignoreEnterKeyUp","ignoreClick","useState","listboxFocusRequested","requestListboxFocus","focusListboxIfRequested","useCallback","current","focus","handleListboxRef","useEffect","createHandleMouseDown","otherHandlers","event","_otherHandlers$onMous","onMouseDown","call","defaultPrevented","createHandleButtonClick","_otherHandlers$onClic","onClick","createHandleButtonKeyDown","_otherHandlers$onKeyD","onKeyDown","key","preventDefault","createHandleListboxKeyUp","_otherHandlers$onKeyU","onKeyUp","closingKeys","includes","_buttonRef$current","createHandleListboxItemClick","_otherHandlers$onClic2","createHandleListboxBlur","_otherHandlers$onBlur","onBlur","listboxReducer","action","newState","type","keyDown","selectedValue","highlightedValue","blur","optionsChange","ref","getButtonRootProps","getRootProps","buttonActive","active","buttonFocusVisible","focusVisible","selectedOption","useMemo","_props$options$find","filter","o","find","useListboxParameters","onChangeMultiple","id","isOptionDisabled","_o$disabled","optionComparer","v","e","newOptions","newValues","map","onChangeSingle","_o$disabled2","option","_option$value","_option$value2","stateReducer","getListboxRootProps","getListboxOptionProps","getOptionProps","getOptionState","highlightedOption","listboxSelectedOption","getButtonProps","role","getListboxProps","useDebugValue"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@mui/base/SelectUnstyled/useSelect.js"],"sourcesContent":["import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useControlled as useControlled, unstable_useForkRef as useForkRef, unstable_useId as useId } from '@mui/utils';\nimport { useButton } from '../ButtonUnstyled';\nimport { useListbox, defaultListboxReducer, ActionTypes } from '../ListboxUnstyled';\nimport defaultOptionStringifier from './defaultOptionStringifier';\nfunction useSelect(props) {\n  const {\n    buttonRef: buttonRefProp,\n    defaultValue,\n    disabled = false,\n    listboxId: listboxIdProp,\n    listboxRef: listboxRefProp,\n    multiple = false,\n    onChange,\n    onOpenChange,\n    open = false,\n    options,\n    optionStringifier = defaultOptionStringifier,\n    value: valueProp\n  } = props;\n  const buttonRef = React.useRef(null);\n  const handleButtonRef = useForkRef(buttonRefProp, buttonRef);\n  const listboxRef = React.useRef(null);\n  const listboxId = useId(listboxIdProp);\n  const [value, setValue] = useControlled({\n    controlled: valueProp,\n    default: defaultValue,\n    name: 'SelectUnstyled',\n    state: 'value'\n  });\n\n  // prevents closing the listbox on keyUp right after opening it\n  const ignoreEnterKeyUp = React.useRef(false);\n\n  // prevents reopening the listbox when button is clicked\n  // (listbox closes on lost focus, then immediately reopens on click)\n  const ignoreClick = React.useRef(false);\n\n  // Ensure the listbox is focused after opening\n  const [listboxFocusRequested, requestListboxFocus] = React.useState(false);\n  const focusListboxIfRequested = React.useCallback(() => {\n    if (listboxFocusRequested && listboxRef.current != null) {\n      listboxRef.current.focus();\n      requestListboxFocus(false);\n    }\n  }, [listboxFocusRequested]);\n  const handleListboxRef = useForkRef(listboxRefProp, listboxRef, focusListboxIfRequested);\n  React.useEffect(() => {\n    focusListboxIfRequested();\n  }, [focusListboxIfRequested]);\n  React.useEffect(() => {\n    requestListboxFocus(open);\n  }, [open]);\n  const createHandleMouseDown = otherHandlers => event => {\n    var _otherHandlers$onMous;\n    otherHandlers == null ? void 0 : (_otherHandlers$onMous = otherHandlers.onMouseDown) == null ? void 0 : _otherHandlers$onMous.call(otherHandlers, event);\n    if (!event.defaultPrevented && open) {\n      ignoreClick.current = true;\n    }\n  };\n  const createHandleButtonClick = otherHandlers => event => {\n    var _otherHandlers$onClic;\n    otherHandlers == null ? void 0 : (_otherHandlers$onClic = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic.call(otherHandlers, event);\n    if (!event.defaultPrevented && !ignoreClick.current) {\n      onOpenChange == null ? void 0 : onOpenChange(!open);\n    }\n    ignoreClick.current = false;\n  };\n  const createHandleButtonKeyDown = otherHandlers => event => {\n    var _otherHandlers$onKeyD;\n    otherHandlers == null ? void 0 : (_otherHandlers$onKeyD = otherHandlers.onKeyDown) == null ? void 0 : _otherHandlers$onKeyD.call(otherHandlers, event);\n    if (event.defaultPrevented) {\n      return;\n    }\n    if (event.key === 'Enter') {\n      ignoreEnterKeyUp.current = true;\n    }\n    if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {\n      event.preventDefault();\n      onOpenChange == null ? void 0 : onOpenChange(true);\n    }\n  };\n  const createHandleListboxKeyUp = otherHandlers => event => {\n    var _otherHandlers$onKeyU;\n    otherHandlers == null ? void 0 : (_otherHandlers$onKeyU = otherHandlers.onKeyUp) == null ? void 0 : _otherHandlers$onKeyU.call(otherHandlers, event);\n    if (event.defaultPrevented) {\n      return;\n    }\n    const closingKeys = multiple ? ['Escape'] : ['Escape', 'Enter', ' '];\n    if (open && !ignoreEnterKeyUp.current && closingKeys.includes(event.key)) {\n      var _buttonRef$current;\n      buttonRef == null ? void 0 : (_buttonRef$current = buttonRef.current) == null ? void 0 : _buttonRef$current.focus();\n    }\n    ignoreEnterKeyUp.current = false;\n  };\n  const createHandleListboxItemClick = otherHandlers => event => {\n    var _otherHandlers$onClic2;\n    otherHandlers == null ? void 0 : (_otherHandlers$onClic2 = otherHandlers.onClick) == null ? void 0 : _otherHandlers$onClic2.call(otherHandlers, event);\n    if (event.defaultPrevented) {\n      return;\n    }\n    if (!multiple) {\n      onOpenChange == null ? void 0 : onOpenChange(false);\n    }\n  };\n  const createHandleListboxBlur = otherHandlers => event => {\n    var _otherHandlers$onBlur;\n    otherHandlers == null ? void 0 : (_otherHandlers$onBlur = otherHandlers.onBlur) == null ? void 0 : _otherHandlers$onBlur.call(otherHandlers, event);\n    if (!event.defaultPrevented) {\n      onOpenChange == null ? void 0 : onOpenChange(false);\n    }\n  };\n  const listboxReducer = (state, action) => {\n    const newState = defaultListboxReducer(state, action);\n\n    // change selection when listbox is closed\n    if (action.type === ActionTypes.keyDown && !open && (action.event.key === 'ArrowUp' || action.event.key === 'ArrowDown')) {\n      return _extends({}, newState, {\n        selectedValue: newState.highlightedValue\n      });\n    }\n    if (action.type === ActionTypes.blur || action.type === ActionTypes.setValue || action.type === ActionTypes.optionsChange) {\n      return _extends({}, newState, {\n        highlightedValue: newState.selectedValue\n      });\n    }\n    return newState;\n  };\n  const {\n    getRootProps: getButtonRootProps,\n    active: buttonActive,\n    focusVisible: buttonFocusVisible\n  } = useButton({\n    disabled,\n    ref: handleButtonRef\n  });\n  const selectedOption = React.useMemo(() => {\n    var _props$options$find;\n    return props.multiple ? props.options.filter(o => value.includes(o.value)) : (_props$options$find = props.options.find(o => o.value === value)) != null ? _props$options$find : null;\n  }, [props.multiple, props.options, value]);\n  let useListboxParameters;\n  if (props.multiple) {\n    const onChangeMultiple = onChange;\n    useListboxParameters = {\n      id: listboxId,\n      isOptionDisabled: o => {\n        var _o$disabled;\n        return (_o$disabled = o == null ? void 0 : o.disabled) != null ? _o$disabled : false;\n      },\n      optionComparer: (o, v) => (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value),\n      listboxRef: handleListboxRef,\n      multiple: true,\n      onChange: (e, newOptions) => {\n        const newValues = newOptions.map(o => o.value);\n        setValue(newValues);\n        onChangeMultiple == null ? void 0 : onChangeMultiple(e, newValues);\n      },\n      options,\n      optionStringifier,\n      value: selectedOption\n    };\n  } else {\n    const onChangeSingle = onChange;\n    useListboxParameters = {\n      id: listboxId,\n      isOptionDisabled: o => {\n        var _o$disabled2;\n        return (_o$disabled2 = o == null ? void 0 : o.disabled) != null ? _o$disabled2 : false;\n      },\n      optionComparer: (o, v) => (o == null ? void 0 : o.value) === (v == null ? void 0 : v.value),\n      listboxRef: handleListboxRef,\n      multiple: false,\n      onChange: (e, option) => {\n        var _option$value, _option$value2;\n        setValue((_option$value = option == null ? void 0 : option.value) != null ? _option$value : null);\n        onChangeSingle == null ? void 0 : onChangeSingle(e, (_option$value2 = option == null ? void 0 : option.value) != null ? _option$value2 : null);\n      },\n      options,\n      optionStringifier,\n      stateReducer: listboxReducer,\n      value: selectedOption\n    };\n  }\n  const {\n    getRootProps: getListboxRootProps,\n    getOptionProps: getListboxOptionProps,\n    getOptionState,\n    highlightedOption,\n    selectedOption: listboxSelectedOption\n  } = useListbox(useListboxParameters);\n  const getButtonProps = (otherHandlers = {}) => {\n    return _extends({}, getButtonRootProps(_extends({}, otherHandlers, {\n      onClick: createHandleButtonClick(otherHandlers),\n      onMouseDown: createHandleMouseDown(otherHandlers),\n      onKeyDown: createHandleButtonKeyDown(otherHandlers)\n    })), {\n      role: 'combobox',\n      'aria-expanded': open,\n      'aria-haspopup': 'listbox',\n      'aria-controls': listboxId\n    });\n  };\n  const getListboxProps = (otherHandlers = {}) => getListboxRootProps(_extends({}, otherHandlers, {\n    onBlur: createHandleListboxBlur(otherHandlers),\n    onKeyUp: createHandleListboxKeyUp(otherHandlers)\n  }));\n  const getOptionProps = (option, otherHandlers = {}) => {\n    return getListboxOptionProps(option, _extends({}, otherHandlers, {\n      onClick: createHandleListboxItemClick(otherHandlers)\n    }));\n  };\n  React.useDebugValue({\n    selectedOption: listboxSelectedOption,\n    highlightedOption,\n    open\n  });\n  return {\n    buttonActive,\n    buttonFocusVisible,\n    disabled,\n    getButtonProps,\n    getListboxProps,\n    getOptionProps,\n    getOptionState,\n    open,\n    value\n  };\n}\nexport default useSelect;"],"mappings":";AAAA,OAAOA,QAAQ,MAAM,oCAAoC;AACzD,OAAO,KAAKC,KAAK,MAAM,OAAO;AAC9B,SAASC,sBAAsB,IAAIC,aAAa,EAAEC,mBAAmB,IAAIC,UAAU,EAAEC,cAAc,IAAIC,KAAK,QAAQ,YAAY;AAChI,SAASC,SAAS,QAAQ,mBAAmB;AAC7C,SAASC,UAAU,EAAEC,qBAAqB,EAAEC,WAAW,QAAQ,oBAAoB;AACnF,OAAOC,wBAAwB,MAAM,4BAA4B;AACjE,SAASC,SAAS,CAACC,KAAK,EAAE;EACxB,IACaC,aAAa,GAYtBD,KAAK,CAZPE,SAAS;IACTC,YAAY,GAWVH,KAAK,CAXPG,YAAY;IAAA,kBAWVH,KAAK,CAVPI,QAAQ;IAARA,QAAQ,gCAAG,KAAK;IACLC,aAAa,GAStBL,KAAK,CATPM,SAAS;IACGC,cAAc,GAQxBP,KAAK,CARPQ,UAAU;IAAA,kBAQRR,KAAK,CAPPS,QAAQ;IAARA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